package enum2;

public class EnumTest {
    public static void main(String[] args) {
        int a=5;
        int b=6;
        System.out.println(a==b?"a等于b":a>=b?"a>b":"a<b");
        System.out.println(div(3,50)==Result.SUCCESS ?"计算成功":"计算失败");
    }
    public static Result div(int a, int b){
        try {
            int c=a/b;
            return Result.SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.FAIL;
        }
    }
}
//枚举每一个值可以看做是常量
enum Result{
    SUCCESS,FAIL,MADONGMEI
}
